home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
7_9.lha
/
7_9
/
7_9_ins.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
607b
|
24 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
/ DELETE #include "nlink.h"
/ insert an entry at the beginning of the list
oid dlist::insert(dlink *a)
/ DELETE cout << "dlist::insert(" << (char*)(((nlink*)a)->x) << ")\n";
if (last)
last->next->insert(a);
else
{
last = a;
last->next = last->prev = last;
}
/DELETE
/DELETE cout << "\tlast: " << (nlink*)last;
/DELETE cout << "\tfrom last->next\n";
/DELETE for (a = last->next; a != last; a = a->next)
/DELETE cout << "\tnext: " << (nlink*)a;